package com.ruoyi.dictionary.Service.impl;

import com.ruoyi.dictionary.Service.RicePestsService;
import com.ruoyi.dictionary.domain.RicePests;
import com.ruoyi.dictionary.mapper.RicePestsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author DELL
 */
@Service
public class RicePestsServiceImpl implements RicePestsService {

    @Autowired
    private RicePestsMapper ricePestsMapper;

    /**
     * 查询水稻害虫列表
     * @param ricePests
     * @return
     */
    @Override
    public List<RicePests> selectRicePestsList(RicePests ricePests) {
        List<RicePests> list = ricePestsMapper.selectRicePestsList(ricePests);
        return list;
    }

    /**
     * 新增水稻害虫
     * @param ricePests
     * @return
     */
    @Override
    public int insertRicePests(RicePests ricePests) {
        return ricePestsMapper.insertRicePests(ricePests);
    }

    /**
     * 删除水稻害虫信息
     * @param ricePestsId
     * @return
     */
    @Override
    public int deleteRicePestsByIds(Long[] ricePestsId) {
        int row = ricePestsMapper.deleteRicePestsByIds(ricePestsId);
        return row;
    }

    /**
     * 更新水稻害虫信息
     * @param ricePests
     * @return
     */
    @Override
    public int updateRicePests(RicePests ricePests) {
        return ricePestsMapper.updateRicePests(ricePests);
    }
}
